classdef prices_amz < handle
    
    properties

rowHeadings ={...
    'Type',...
    'API name',...
    'Memory',... %(GB)
    'Compute Unit',...
    'Instance Storage',... %(GB)
    'CPU architrecture',...
    'IO performance',...
    'Price/year',...
    'Price/hour'};
   
micro=... 
[{'Micro','t1.micro',6.13, 1 ,160,'32-bit or 64-bit','Low',54.00, 0.02}]; % '--EBS~storage only

standard=...
[{'Small',		'm1.small', 1.7,    1,  160,    '32-bit', 'Moderate',227.00, 0.085}
 {'Large',		'm1.large', 7.5,    4,  850,    '64-bit',	'High',		910.00,  0.34 }
 {'Extra large',	'm1.xlarge',15,8,   1690 ,'64-bit ','High',1820.00,     0.68}];
 
high_Memory=...
[{'Extra Large',	'm2.xlarge', 17.1 ,6.5, 420 ,'64-bit','Moderate',1325.00, 0.50}
{'Double Extra Large','m2.2xlarge', 34.2 , 13, 850,'64-bit','High',2650.00, 1.00}
{'Quadruple Extra Large','m2.4xlarge', 68.4 , 26 , 1690 ,'64-bit','High',5300.00, 2.00}];

high_CPU=...
[{'Medium','c1.medium', 1.7  , 5 , 350 ,'32-bit','Moderate',455.00, 0.17}
{'Extra-large','c1.xlarge', 7  , 20 , 1690 ,'64-bit','High',1820.00, 0.68}];

cluster_Compute=...
[{'Quadruple Extra Large','cc1.4xlarge', 23 , 33.5 , 1690 ,'64-bit','Very High (10 Gb Ethernet)',4290.00,1.60 }];

cluster_GPU=...
[{'Quadruple Extra Large','cg1.4xlarge', 22 ,33.5 ,1690,... %  plus 2 x~NVIDIA~Tesla Fermi~M2050~GPUs
    '64-bit','(10 Gb Ethernet)',5630.00, 2.10}];

    end %properties
    methods
        function obj=prices_amz()
        end
        
        
        function all=collect(obj)
%             all = [obj.micro; obj.standard; obj.high_Memory; obj.high_CPU;...
%                 obj.cluster_Compute; obj.cluster_GPU];
             all = [obj.standard ];

        end
    
        function b=get_api_names(obj)        
            a=obj.collect;
            b=a(:,2);
        end
        
        function b=get_compute_units(obj)        
            a=obj.collect;
            b=cell2num(a(:,4));
        end
        
         function b=get_number_of_types(obj)
            a=obj.collect; 
            b= size(a,1);
         end         
            
        function b=get_hourly_price_by_id(obj,id)
            a=obj.collect; 
            b=cell2num(a(id,9)); 
        end
        
        function b=get_hourly_price_by_type(obj,inst_type)
            a=obj.collect; 
            for i=1:size(a,1)
                k=a(i,2);
                if k{:}==inst_type
                    b=cell2num(a(i,9)); 
                    break;
                end
            end
        end
            
        function b=get_hourly_price(obj)
            a=obj.collect; 
            b=cell2num(a(:,9));
        end
        
        function b=get_price_per_year(obj)
            a=obj.collect;
            b=cell2num(a(:,8));
        end
        
    end
end
